{template 'common/header'}
<div class="panel panel-default">
  <!-- Default panel contents -->
  <header class="panel-heading font-bold mypanelhead">
  	黑名单管理
  </header>

  <div class="panel-body">
    <div class="alert alert-warning alert-dismissible" role="alert">
	  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	  <p>黑名单说明</p>
	  {if $type== 2} <p>在二手交易信息管理中可以屏蔽信息，屏蔽后可以在这里进行管理。</p>{elseif $type == 1}<p>在小区拼车信息管理中可以屏蔽信息，屏蔽后可以在这里进行管理</p>{/if}
	</div>
	<div>
	  	<a style="display:block;" href="{php echo $this->createWebUrl('black',array('type' => 1))}" class="btn btn-s-sm text-sm btn-info navbar-right m-r-sm"><i class="fa fa-eye-slash text-sg"></i> 拼车信息黑名</a>&nbsp;&nbsp;

	  <a style="display:block" href="{php echo $this->createWebUrl('black',array('type' => 2))}" class="btn btn-s-sm text-sm btn-success navbar-right m-r-sm"><i class="fa fa-eye-slash text-sg"></i>二手交易黑名单</a>
	  	
	  </div>
  </div>

  

  <!-- Table -->
  <table class="table">
    <thead>
				<tr>
					<th class="col-sm-1"></th>
					<th class="col-sm-2">标题</th>
					<th class="col-sm-1">类别</th>
					<th class="col-sm-2">来自</th>
					<th class="col-sm-2">发布时间</th>

					<th class="col-sm-3">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $item}
				<tr>
					<td></td>
					<td>{$item['title']}</td>
					<td>{if $type == 2}二手交易{else}小区拼车{/if}</td>
					<td>{$item['mobile']}</td>
					<td>{php echo date('Y-m-d H:i',$item['createtime'])}</td>
					<td>
						<a onclick="toblack({$item['id']},{$type})" href="#" class="btn btn-primary btn-sm" id='toblack'><i class="fa fa-eye"></i> 解除屏蔽 </a>&nbsp;
						<a onclick="del({$item['id']},{$type})" href="#" class="btn btn-primary btn-sm" ><i class="fa fa-times"></i> 删除 </a>
					</td>
				</tr>
				{/loop}
			</tbody>
  </table>
</div>
<script type="text/javascript">
    	function del(id,type){
	    	var id = id;
	            $.post("{php echo $this->createWebUrl('black')}", {"op":"delete","id":id,"type":type}, function(msg){
	                if (msg.status == 1) {
		                    	setTimeout(function(){
		                        	window.location.reload();
		                   		 },100);
		                    };
	            },'json');
	    }
    	function toblack(id,type){
	    	var id = id;
	            $.post("{php echo $this->createWebUrl('black')}", {"op":"toblack","id":id,"type":type}, function(msg){
	                if (msg.status == 1) {
		                    	setTimeout(function(){
		                        	window.location.reload();
		                   		 },100);
		                    };
	            },'json');
	    }
</script>
{template 'common/footer'}